package com.hsylient.javase.chapter06.demo02;

import lombok.SneakyThrows;
import org.junit.Test;

/**
 * java异常机制的总父类：Throwable
 * 所有的异常还有错误都是继承了这个类
 *
 */
public class MyThrowable {

    @SneakyThrows
    public static void main(String[] args) {
        Class.forName("com.mysql.jdbc.Driver");
    }

    @Test
    public void testConstructor() {
        Throwable throwAble = new Throwable();
        System.out.println(throwAble);
    }

    @Test
    public void testConstructor2() {
        Throwable throwable = new Throwable("构造方法中的内容，可以通过getMessage()方法输出");
        System.out.println(throwable.getMessage());
    }
}
